/**
 * 统一管理用户相关的接口
*/
import request from "@/utils/request";



//管理接口-mock
// import { loginForm, loginResponseData, userResponseData } from "./type.ts";
/**
enum API{
    LOGIN_URL = "/user/login",
    USERINFO_URL = "/user/info"
}

//对外暴露请求函数
//登录接口
export const reqLogin = (data:loginForm) => {
    return request.post<any,loginResponseData>(API.LOGIN_URL,data);
}

//获取用户信息
export const reqUserInfo = () => {
    return request.get<any,userResponseData>(API.USERINFO_URL);
}
*/

//@ts-ignore
import { loginFormData, loginResponseData, userInfoResponseData } from "./type.ts";
//管理接口-真实接口
enum API {
    LOGIN_URL = "/admin/acl/index/login",
    USERINFO_URL = "/admin/acl/index/info",
    USERLOGOUT_URL = "/admin/acl/index/logout"
}

//登录接口
export const reqLogin = (data:loginFormData) => {
    return request.post<any,loginResponseData>(API.LOGIN_URL,data);
}

//获取用户信息接口
export const reqUserInfo = () => {
    return request<any,userInfoResponseData>({
        url:API.USERINFO_URL,
        method:"get"
    })
}

//用户退出登录接口
export const reqLogout = () => {
    return request.post<any,any>(API.USERLOGOUT_URL);
}
